import axios from "axios";
import { defineStore } from "pinia";
import { parse } from "vue/compiler-sfc";

export const useLoveTolkStore = defineStore('loveTalk', ({
    actions: {
        async getTalka() {
            const { data: { id: id }, data: { hitokoto: content } } = await axios.get('https://v1.hitokoto.cn/')
            this.loveTalkList.push({ id, content })
        }
    },
    state() {
        return {
            loveTalkList: JSON.parse(localStorage.getItem('talkList') as string) || [{id:1,content:'3213213'}]
        }
    }
}))